package com.example.resourceSharingPlatform.mappers;

import com.example.resourceSharingPlatform.entity.User;
import org.springframework.jdbc.core.RowMapper;


import java.sql.ResultSet;
import java.sql.SQLException;

public class UserRowMapper implements RowMapper<User> {
    @Override
    public User mapRow(ResultSet rs, int i)throws SQLException{
        User user = new User();
        user.setId(rs.getString("id"));
        user.setName(rs.getString("name"));
        user.setAge(rs.getInt("age"));
        user.setGender(rs.getString("gender"));
        user.setPhoto(rs.getString("photo"));
        user.setTel(rs.getString("tel"));
        return user;
    }
}
